#pragma once

#include "JoinPoint.h"

template <class TTypeFilter,class TMethodMatcher>
class CPointcut: public IPointcut
{
	TTypeFilter typeFilter;
	TMethodMatcher methodMatcher;
public:
	CPointcut()
		:typeFilter(),methodMatcher()
	{
	}
	CPointcut(TTypeFilter _typeFilter,TMethodMatcher _methodMatcher)
		:typeFilter(_typeFilter),methodMatcher(_methodMatcher)
	{
	}
	ITypeFilter& GetTypeFilter()
	{
		return typeFilter;
	}
	IMethodMatcher& GetMethodMatcher()
	{
		return methodMatcher;
	}
	bool Matches(CJoinPoint& joinPoint)
	{
		return typeFilter.Matches(joinPoint) && methodMatcher.Matches(joinPoint);
	}
};

